home *** CD-ROM | disk | FTP | other *** search
- Path: yama.mcc.ac.uk!dmu!usenet
- From: Timothy Eves <se1te@dmu.ac.uk>
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: Plugs Ins
- Date: Mon, 11 Mar 1996 19:42:22 +0000
- Organization: De Montfort Univerity
- Message-ID: <3144821E.794B@dmu.ac.uk>
- References: <Pine.SOL.3.91.960307160455.27918A@sirius> <Dnws3v.7o0@cix.compulink.co.uk>
- NNTP-Posting-Host: holst.cms.dmu.ac.uk
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (X11; I; OSF1 V3.2 alpha)
-
- Jolyon Ralph wrote:
- >
- > > I am writing a program, and would like to use Plugin code. How do you
- > > load an executable Amiga file, and what, point the program counter at
- > > it? (I am writing in assembler) Someone said something about
- > > LoadSeg() - Do I use this?
- >
- > You don't want to do that! The easiest and best way to do plug-in code is
- > to use the amiga shared library format (ie. xxx.library - although you
- > don't have to call it that). We use that for all the modules in
- > Photogenics. It's easy to write, easy to call from your code, and the OS
- > handles caching them in RAM and flushing them when no longer needed for
- > you.
- >
- > Jolyon
-
- Easiest?? I don't know... It's easiest from the point of view of loading into
- the app, but I think it makes the plugins themselves harder to write.
-
- Any way I've checked and found out a way doing this using LoadSeg()
-
- A seglist as returned by LoadSeg will has this structure:
-
- LONG pad ;aligns the seg to long word boundry
- LONG size ;How big this segment is
- APTR next_seg ;The next segment in this seglist.
- start of code
- .
- .
-
- If you do a load seg you can then jump 3 LongWords into the pointer returned
- by LoadSeg() and start execution from there.
-
- When you write you're code just make sure the 1st hunk of the object file
- contains you're start code and the 1st code line is a function.
-
- Hmm... after all that perhaps the Library based method is easier...
- --
- ------------------------------------------------------------O----------------
- Out of the gloom came a voice, "Smile and be happy things| EMail To:
- could be worse", it said. So I smiled and I was happy,| se1te@dmu.ac.uk
- and behold things did get worse. |
- ------------------------------------------------------------O----------------
-